package com.xxzuibang.day6.testti;
//2.	编写一个程序，生成0-9之间的100个整数并且显示每一个数的个数
public class Test02 {
    public static void main(String[] args) {

        int[] numbers=new int[100];
        int[] counts=new int[10];
        for (int i = 0; i < 100; i++) {
            numbers[i]=(int)(Math.random()*10);
            counts[numbers[i]]++;
        }
        System.out.println("100个整数为：");
        for (int i = 1; i <=numbers.length; i++) {
            if(i%10!=0){
                System.out.print(numbers[i-1]+" ");
            }else{
                System.out.print(numbers[i-1]+" ");
            }
        }
        System.out.println("每一个整数为");
        for (int i = 1; i < counts.length; i++) {
            System.out.print(counts[i-1]+" ");
        }
    }
}
